<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="getData">GET</button>​
    <button id="postData">POST</button>

<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    document.querySelector('#getData').addEventListener('click',()=>{
        axios({
            url:'https://mock.apifox.cn/m1/3083103-0-default/emps/list',
            method:'GET'
        }).then((result)=>{
            console.log(result.data);
        }).catch((err)=>{
            console.log(err);
        })
    })

    document.querySelector('#postData').addEventListener('click',()=>{
        axios({
            url:'https://mock.apifox.cn/m1/3083103-0-default/emps/update',
            method:'POST'
        }).then((result)=>{
            console.log(result.data);
        }).catch((err)=>{
            console.log(err);
        })
    })
</script>

</body>
</html>